#include <stdio.h>
#define File_path "/home/richard/LinuxTest/baseIO/hello.txt"

int main()
{
    FILE *fp; //指向操作文件的文件指针
    char buf[] = "Hello! I like Linux C program!";
    char buf2[80];
    fp = fopen(File_path, "w");
    fprintf(fp, "%s", buf); //向该文件流输出字符串数据buf
    fprintf(fp, "\n");      //向该文件流输出换行
    fclose(fp);
    fp = fopen(File_path, "r");
    fscanf(fp, "%s", buf2); //将该文件流中的数据读入到buf2
    fclose(fp);
    printf("%s\n", buf2);
    return 0;
}